package com.labofjet.blogv3.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.labofjet.aspect.BaseLogAspect;

@Aspect
@Component
public class LogAspect extends BaseLogAspect {

    private static final Logger LOGGER = LoggerFactory.getLogger(LogAspect.class);

	@Around("within(@org.springframework.stereotype.Controller *)")
	public Object logController(ProceedingJoinPoint pjp) throws Throwable {
		return doLog(pjp, "Controller");
	}

	// @Around("execution(* gov.gt3.iitms.sbf..*Service.*(..))")
	public Object logService(ProceedingJoinPoint pjp) throws Throwable {
		return doLog(pjp, "Service");
	}

	// @Around("execution(* gov.gt3.iitms.sbf..*Facade.*(..))")
	public Object logFacade(ProceedingJoinPoint pjp) throws Throwable {
		return doLog(pjp, "Facade");
	}

}
